home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / FindBin.z / FindBin
Encoding:
Text File  |  1998-10-30  |  2.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4. FFFFiiiinnnnddddBBBBiiiinnnn((((3333))))                                                          FFFFiiiinnnnddddBBBBiiiinnnn((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      FindBin - Locate directory of original perl script
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.       use FindBin;
  13.       use lib "$FindBin::Bin/../lib";
  14.  
  15.       or
  16.  
  17.       use FindBin qw($Bin);
  18.       use lib "$Bin/../lib";
  19.  
  20.  
  21. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  22.      Locates the full path to the script bin directory to allow the use of
  23.      paths relative to the bin directory.
  24.  
  25.      This allows a user to setup a directory tree for some software with
  26.      directories <root>/bin and <root>/lib and then the above example will
  27.      allow the use of modules in the lib directory without knowing where the
  28.      software tree is installed.
  29.  
  30.      If perl is invoked using the ----eeee option or the perl script is read from
  31.      STDIN then FindBin sets both $Bin and $RealBin to the current directory.
  32.  
  33. EEEEXXXXPPPPOOOORRRRTTTTAAAABBBBLLLLEEEE VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  34.       $Bin         - path to bin directory from where script was invoked
  35.       $Script      - basename of script from which perl was invoked
  36.       $RealBin     - $Bin with all links resolved
  37.       $RealScript  - $Script with all links resolved
  38.  
  39.  
  40. KKKKNNNNOOOOWWWWNNNN BBBBUUUUGGGGSSSS
  41.      if perl is invoked as
  42.  
  43.         perl filename
  44.  
  45.      and _f_i_l_e_n_a_m_e does not have executable rights and a program called
  46.      _f_i_l_e_n_a_m_e exists in the users $ENV{PATH} which satisfies both ----xxxx and ----TTTT
  47.      then FindBin assumes that it was invoked via the $ENV{PATH}.
  48.  
  49.      Workaround is to invoke perl as
  50.  
  51.       perl ./filename
  52.  
  53.  
  54. AAAAUUUUTTTTHHHHOOOORRRRSSSS
  55.      Graham Barr <_b_o_d_g@_t_i_u_k._t_i._c_o_m> Nick Ing-Simmons <_n_i_k@_t_i_u_k._t_i._c_o_m>
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FFFFiiiinnnnddddBBBBiiiinnnn((((3333))))                                                          FFFFiiiinnnnddddBBBBiiiinnnn((((3333))))
  71.  
  72.  
  73.  
  74. COPYRIGHT
  75.      Copyright (c) 1995 Graham Barr & Nick Ing-Simmons. All rights reserved.
  76.      This program is free software; you can redistribute it and/or modify it
  77.      under the same terms as Perl itself.
  78.  
  79. RRRREEEEVVVVIIIISSSSIIIIOOOONNNN
  80.      $Revision: 1.4 $
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.